#!/bin/bash
:<<!
 model_name = bert-base-chinese
 model_name = xlm-roberta-base
 model_name = nghuyong/ernie-gram-zh
 model_name = nghuyong/ernie-3.0-base-zh
 model_name = xlm-roberta-large
 model_name = hfl/chinese-bert-wwm-ext
 model_name = hfl/chinese-roberta-wwm-ext-large
 model_name = hfl/chinese-electra-180g-base-discriminator
 model_name = hfl/chinese-electra-180g-small-discriminator
 model_name = hfl/chinese-electra-180g-large-discriminator
 model_name = hfl/chinese-roberta-wwm-ext
 model_name = hfl/chinese-macbert-large
 model_name = hfl/chinese-macbert-base
 model_name = clue/roberta_chinese_pair_large
 model_name = uer/bart-base-chinese-cluecorpussmall
 model_name = fnlp/bart-base-chinese
 model_name = trueto/medbert-base-wwm-chinese
 model_name = trueto/medbert-kd-chinese
 model_name = freedomking/mc-bert
 model_name = uer/gpt2-chinese-cluecorpussmall
!

TIME=$(date "+%Y-%m-%d_%H:%M:%S")
NNODES=1
Seed=42
WORKERS=2

# full-data
PER_NODE=2
DEVICE_IDS=0,1
scheduler_name=linear
num_cpu_threads_per_process=1
METHOD=
wandb_mode=disabled
model_name=
max_length=
min_entity_len=
max_entity_len=
data_name=
warm_factor=
weight_decay=
weight_label=
K_Shot=
if [[ ${data_name} == "XXXX" ]]; then 
    max_entity_len=
fi

pet_patterns_idx=0
sample_num=
# 分布式启动的话
main_process_port=
if [[ ${K_Shot} ]]; then
    project=Pre_trained;
    batch_size=
    epoch_size=
    train_path=
else
    project=;
    batch_size=
    epoch_size=
    train_path=
fi
dev_path=
test_path=
output_path=
checkpoint_save_path=
pretrained_checkpoint_path=
log_path=
lm_learning_rate=
others_learning_rate=

CMD="
accelerate launch
--num_cpu_threads_per_process=$num_cpu_threads_per_process
--multi_gpu
--main_process_port=$main_process_port
--mixed_precision=no
--num_machines=$NNODES
--num_processes=$PER_NODE
--gpu_ids=$DEVICE_IDS
main.py
--model_name=$model_name
--project=$project
--checkpoint_save_path=$checkpoint_save_path
--train_path=$train_path
--dev_path=$dev_path
--test_path=$test_path
--user_dict=$user_dict
--workers=$WORKERS
--epochs=$epoch_size
--batch_size=$batch_size
--weight_decay=$weight_decay
--max_length=$max_length
--max_entity_len=$max_entity_len
--min_entity_len=$min_entity_len
--scheduler_name=$scheduler_name
--warm_factor=$warm_factor
--lm_learning_rate=$lm_learning_rate
--others_learning_rate=$others_learning_rate
--seed=$Seed
--log_path=$log_path
--pretrained_checkpoint_path=$pretrained_checkpoint_path
--output_path=$output_path
--data_name=$data_name
--k_shot=$K_Shot
--weight_label ${weight_label[*]}
--pet_patterns_idx=$pet_patterns_idx
--method=$METHOD
--wandb_mode=$wandb_mode
"
$CMD